package com.shuigu.ai.domain;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import dev.langchain4j.service.MemoryId;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.shuigu.common.annotation.Excel;
import com.shuigu.common.core.domain.BaseEntity;

/**
 * 应用对象 app
 *
 * @author shuigu
 * @date 2025-09-14
 */
// resultMap 一旦指定，MyBatis-Plus 在查询时就不会再用 自动映射，而是强制使用你自己定义在 AppMapper.xml 里的 <resultMap id="AppResult">。
@TableName(value = "app", resultMap = "com.shuigu.ai.mapper.AppMapper.AppResult")
public class App extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** id */
    @TableId(value = "id",type = IdType.AUTO)
    private Long id;

    /** 应用名称 */
    @Excel(name = "应用名称")
    private String appName;

    /** 应用封面 */
    @Excel(name = "应用封面")
    private String cover;

    /** 应用初始化的 prompt */
    @Excel(name = "应用初始化的 prompt")
    private String initPrompt;

    /** 代码生成类型（枚举） */
    @Excel(name = "代码生成类型", readConverterExp = "枚=举")
    private String codeGenType;

    /** 部署标识 */
    @Excel(name = "部署标识")
    private String deployKey;

    /** 部署时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "部署时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date deployedTime;

    /** 优先级 */
    @Excel(name = "优先级")
    private Long priority;

    /** 创建用户id */
    @Excel(name = "创建用户id")
    private Long userId;

    /** 是否删除 */
    @Excel(name = "是否删除")
    @TableLogic(value = "0", delval = "1")
    private Long deleted;

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId()
    {
        return id;
    }

    public void setAppName(String appName)
    {
        this.appName = appName;
    }

    public String getAppName()
    {
        return appName;
    }

    public void setCover(String cover)
    {
        this.cover = cover;
    }

    public String getCover()
    {
        return cover;
    }

    public void setInitPrompt(String initPrompt)
    {
        this.initPrompt = initPrompt;
    }

    public String getInitPrompt()
    {
        return initPrompt;
    }

    public void setCodeGenType(String codeGenType)
    {
        this.codeGenType = codeGenType;
    }

    public String getCodeGenType()
    {
        return codeGenType;
    }

    public void setDeployKey(String deployKey)
    {
        this.deployKey = deployKey;
    }

    public String getDeployKey()
    {
        return deployKey;
    }

    public void setDeployedTime(Date deployedTime)
    {
        this.deployedTime = deployedTime;
    }

    public Date getDeployedTime()
    {
        return deployedTime;
    }

    public void setPriority(Long priority)
    {
        this.priority = priority;
    }

    public Long getPriority()
    {
        return priority;
    }

    public void setUserId(Long userId)
    {
        this.userId = userId;
    }

    public Long getUserId()
    {
        return userId;
    }

    public void setDeleted(Long deleted)
    {
        this.deleted = deleted;
    }

    public Long getDeleted()
    {
        return deleted;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("appName", getAppName())
            .append("cover", getCover())
            .append("initPrompt", getInitPrompt())
            .append("codeGenType", getCodeGenType())
            .append("deployKey", getDeployKey())
            .append("deployedTime", getDeployedTime())
            .append("priority", getPriority())
            .append("userId", getUserId())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .append("deleted", getDeleted())
                .toString();
    }
}
